'use strict';

module.exports = app => {
  const { STRING, INTEGER, DATE } = app.Sequelize;

  const sys_logininfor = app.model.define('sys_logininfor', {
    infoId: {
      type: INTEGER(20),
      comment: "参数主键",
      allowNull: false,
      primaryKey: true,
      field:"info_id",
      autoIncrement: true
    },
    userName: {
      type: STRING(50),
      comment: "",
      field:"user_name",
      defaultValue: ""
    },
    ipaddr: {
      type: STRING(128),
      comment: "",
      defaultValue: ""
    },
    loginLocation: {
      type: STRING,
      comment: "",
      field:"login_location",
      defaultValue: ""
    },
    browser: {
      type: STRING(50),
      comment: "",
      defaultValue: ""
    },
    os: {
      type: STRING(50),
      comment: "",
      defaultValue: ""
    },
    status: {
      type: STRING(1),
      comment: "",
      defaultValue: ""
    },
    msg: {
      type: STRING,
      comment: "",
      defaultValue: ""
    },
  },{
    paranoid:true,
    freezeTableName:true
  });

  return sys_logininfor;
};